The majority of .NET developers write code in object-oriented languages, such as C# and VB.NET. However, object-oriented programming is not the only way of writing compiled .NET applications. F#, a functional programming language, provides an alternative way of doing so. With the latest release of Visual Studio, 15.7, the language has been given a huge upgrade in terms of functionality, libraries and tooling.
By opening the source of F# to the public, Microsoft has significantly speeded up the development of new language features and improvement of the old ones. This is why, when used in Visual Studio, the language has some cutting-edge features that aren't available in any other .NET language. For example, when you add a reference to a module or a function into your code and hover over it, the tooltip that appears enables you to navigate directly to the definition of the referred item.
Indeed, IntelliSense, the ability of the IDE to give you suggestions as you type the code, is much better implemented in the updated F# compared to any other .NET languages. One F# features that doesn't yet exist anywhere else in the Microsoft ecosystem is something that can be referred to as "IntelliSense for data". For example, IDE allows you to scan any arbitrary web page in real time as you type your code. The IDE will then present it in as a structure that is easy to navigate from within the code.
Just like the standard IntelliSense that all .NET developers are familiar with, you will receive suggestions that match the textual pattern that you type. However, while in C# and VB.NET you are limited to only accessing names of properties and methods of a given object, in F# you can access elements based on their actual textual value. One of the things that you can do is access a particular heading on the page based on the actual title that you see on the page. All of this information from the webpage can be accessed directly in your code before you have even executed any of it.
Another handy tool that comes with F# is the ability to run individual functions in interactive window while you are writing the code. This process significantly simplifies debugging, as you can test any of your functions before you even compile your program. The interactive window that comes with F# is much more powerful than Immediate Window that is available with other .NET languages. Unlike the former, the latter can only be used while you are actually running the code. Also, the window available in F# will retain the values of your interactively declared variables in memory, so you can play with your code as much as you want before you build any of it.
As any .NET language, F# can be compiled into an assembly, which can be referenced by and called from any other .NET assembly or executable compiled from any other .NET language. Likewise, most of standard .NET application types can be written in F#.
For more information, follow this link:
Published by Mobile Tech Tracker
Posted on 12 May 2018